Let's begin at the beginning: the HTML that makes up our first page, home.html. Start by clicking the Document Manager icon in the Project Window (Fig. 2-4).
Edit HTML
icon.
<A HREF="http://deiweb/~dei/cgi-bin/tut2/tut2.cgi?FNC=books__Ahome_html" >
<IMG SRC="http://deiweb/~dei/books.gif"></A><H3>Book Search</H3>
The <H3> and <IMG> tags should be familiar to you. The URL
http://deiweb/~dei/cgi-bin/tut2/tut2.cgi?FNC=books__Ahome_html
may look strange. It points to a CGI program on our server deiweb
. The name of the CGI program is tut2.cgi
; the part after the ?
is an argument passed to the CGI, either as argv[1]
or as the contents of the environment variable "QUERY_STRING"
. The argument tells the project CGI what to do-in this case, execute the function Abooks
(represented in the URL as books__A
) from the page home.html. The function Abooks
gets its name from the way it is activated (by clicking on an anchor) and from the name of this particular anchor: books
.
deiweb
, and your username should replace ~dei
.Abooks
does. Close the Document Manager (with File->Close
) and go back to the Project Window. Scroll through the list of activators (Fig. 2-4). Select the activator home.html<A>books
. Click the icon for Object Bind Editor (Selected Activator)
(Fig. 2-4).
There's quite a lot of information in this window. You can see that there's a Data Object called CEZANNE|pubs2|BD_Get_Title_Types
involved, and that this object is a DSQL
. The bind that you're editing is called bind3
. It so happens that my database server (CEZANNE
) is a Sybase server (SYB
).
Moving down to the middle section, you can see that the Arguments<=>Activator is home.html<A>books
. The activator is named books
, and is an anchor (<A>
) on the page home.html
.
In the bottom section, you can see that the Results<=>Template
is books.html
. What does this mean? Simply, that the results from the Data Object (BD_Get_Title_Types
) will be inserted into the Data Sites in the HTML document books.html. The rest of the bottom section describes how this data should be formatted before being inserted into the data sites.
BD_Get_Title_Types
? What does that big, red check mean? And what is an Object Binding, anyway? In the next chapters, you will learn how to create the Bookstore project and master many of the powerful features of Sapphire/Web.